package com.yoomiito.app.adapter.home.reommend;

import androidx.annotation.Nullable;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.home.PanicTime;
import com.yoomiito.app.utils.ResUtil;

import java.util.List;

public class HomeTimeAdapter extends BaseQuickAdapter<PanicTime, BaseViewHolder> {


    public HomeTimeAdapter(@Nullable List<PanicTime> data) {
        super(R.layout.item_time,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PanicTime item) {
        TextView timeTv = helper.getView(R.id.time);
        timeTv.setText(item.getTime());
        TextView statusTv = helper.getView(R.id.status);
        statusTv.setText(item.getStatus());
        timeTv.setTextColor(ResUtil.getColor(item.isSelected()?R.color.color_FF035B:R.color.color_balk_999999));
        statusTv.setTextColor(ResUtil.getColor(item.isSelected()?R.color.color_FF035B:R.color.color_balk_999999));
        helper.addOnClickListener(R.id.item_time);
        View view = helper.getView(R.id.div);
        view.setBackgroundResource(item.isSelected()?R.color.color_FF035B:R.color.color_tran);
    }

}
